package com.nengchuan.kbms.dfs.controller.center;


import com.nengchuan.kbms.dfs.entity.dto.UserFavoriteDTO;
import com.nengchuan.kbms.dfs.service.UserFavoriteService;
import com.nengchuan.model.model.WrappedResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 文件收藏 前端控制器
 * </p>
 *
 * @author abe
 * @since 2020-03-31
 */
@RestController
@RequestMapping("/center/collect")
@Api(tags = "知识库数据后台管理 > 数据中心 > 收藏 【已完成】")
public class CollectController {

    @Autowired
    private UserFavoriteService userFavoriteService;

    @PostMapping("/save")
    @ApiOperation(value = "收藏")
    public WrappedResult<Boolean> save(@RequestBody UserFavoriteDTO userFavoriteDTO) {
        return WrappedResult.success(userFavoriteService.collect(userFavoriteDTO));
    }

}
